﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="INGRESOSERVICIO.aspx.vb" Inherits="IMSS.SA.Formulario_web12" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style3
        {
            text-align: center;
        }
        .style4
        {
            text-align: center;
            height: 21px;
        }
        .style8
        {
            text-align: center;
            width: 233px;
        }
        .style9
        {
            text-align: center;
            height: 21px;
            width: 23px;
        }
        .style10
        {
            text-align: center;
            width: 23px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width:100%; color: #FFFFFF; background-color: #006699; background-image: url('../Styles/r3.PNG'); background-repeat: no-repeat;">
        <tr>
            <td class="style9">
                &nbsp;</td>
            <td class="style4" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style9">
                &nbsp;</td>
            <td class="style4" colspan="2">
                <asp:Label ID="Label1" runat="server" Text="Label" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style9">
                &nbsp;</td>
            <td class="style4" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style9">
                &nbsp;</td>
            <td class="style4" colspan="2">
                INGRESE LOS DATOS DE LA ORDEN DE SERVICIO</td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                SERVICIO</td>
            <td class="style3">
                <asp:TextBox ID="TexSERVICIO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                CEDULA</td>
            <td class="style3">
                <asp:TextBox ID="TexCEDULA" runat="server" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                TIPO</td>
            <td class="style3">
                <asp:TextBox ID="TexTIPO" runat="server" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                FECHA</td>
            <td class="style3">
                <asp:TextBox ID="TexFECHA" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                ESTADO</td>
            <td class="style3">
                <asp:TextBox ID="TexESTADO" runat="server" MaxLength="15"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style3" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style3" colspan="2">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style3" colspan="2">
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
                    AutoGenerateColumns="False" DataKeyNames="Id_servicio" Width="804px" 
                    CellPadding="4" ForeColor="#333333" GridLines="None">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Id_servicio" HeaderText="Id_servicio" 
                            ReadOnly="True" SortExpression="Id_servicio" />
                        <asp:BoundField DataField="Num_Cedula" HeaderText="Num_Cedula" 
                            SortExpression="Num_Cedula" />
                        <asp:BoundField DataField="Tipo" HeaderText="Tipo" 
                            SortExpression="Tipo" />
                        <asp:BoundField DataField="Estado" HeaderText="Estado" 
                            SortExpression="Estado" />
                        <asp:BoundField DataField="Fecha" HeaderText="Fecha" 
                            SortExpression="Fecha" />
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:IMSS.SAConnectionString14 %>" 
                    DeleteCommand="DELETE FROM [ORDEN_SERVICIO] WHERE [Id_servicio] = @Id_servicio" 
                    InsertCommand="INSERT INTO [ORDEN_SERVICIO] ([Id_servicio], [Num_Cedula], [Tipo], [Estado], [Fecha]) VALUES (@Id_servicio, @Num_Cedula, @Tipo, @Estado, @Fecha)" 
                    SelectCommand="SELECT [Id_servicio], [Num_Cedula], [Tipo], [Estado], [Fecha] FROM [ORDEN_SERVICIO]" 
                    
                    UpdateCommand="UPDATE [ORDEN_SERVICIO] SET [Num_Cedula] = @Num_Cedula, [Tipo] = @Tipo, [Estado] = @Estado, [Fecha] = @Fecha WHERE [Id_servicio] = @Id_servicio">
                    <DeleteParameters>
                        <asp:Parameter Name="Id_servicio" Type="String" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="TexSERVICIO" Name="Id_servicio" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexCEDULA" Name="Num_Cedula" 
                            PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="TexTIPO" Name="Tipo" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="TexESTADO" Name="Estado" PropertyName="Text" 
                            Type="String" />
                        <asp:ControlParameter ControlID="TexFECHA" DbType="Date" Name="Fecha" 
                            PropertyName="Text" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Num_Cedula" Type="String" />
                        <asp:Parameter Name="Tipo" Type="String" />
                        <asp:Parameter Name="Estado" Type="String" />
                        <asp:Parameter Name="Fecha" DbType="Date" />
                        <asp:Parameter Name="Id_servicio" Type="String" />
                    </UpdateParameters>
                </asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                <asp:Button ID="ENVIAR" runat="server" Text="ENVIAR" />
            </td>
            <td class="style3">
                <asp:Button ID="BORRAR" runat="server" Text="BORRAR" />
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
